﻿<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8" />
		<title>文章管理 - FCMS后台管理</title>
		<include file="Index/header" />

	</head>

	<body>
		


		<div class="wrap">
			<div class="col-xs-12">

				<div class="table-responsive">
					<table id="sample-table-2" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>标题</th>
								<th>类型</th>
								<th class="hidden-480">作者</th>
								<!--<th class="hidden-480">
									<i class="icon-time bigger-110 hidden-480"></i>
									发布时间
								</th>-->
								<th>
									<i class="icon-time bigger-110 hidden-480"></i>
									最后修改时间
								</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>

						<tbody>
							<foreach  name="list" item="vo">
								<tr>
									<td class="center">
										<label>
											<input type="checkbox" name="id" class="ace" value="{$vo.id}" />
											<span class="lbl"></span>
										</label>
									</td>

									<td>
										<a href="{:U('edit','a_id='.$vo['id'])}">
											<!-- {$vo.title|mb_strlen='utf8'} -->
											<if condition="(mb_strlen($vo['title'],'utf8') gt 25)">{$vo.title|msubstr=0,25,'UTF-8',true}
											<else/>{$vo.title}
											</if>
										</a>
									</td>
									<td>
										<foreach name="types" item="type">
											<if condition="$vo['type'] eq $type['id']">
												{$type.name}
											</if>
										</foreach>
									</td>
									<td class="hidden-480">{$vo.a_name}</td>
									<!--<td class="hidden-480">{$vo.create_time}</td>-->
									<td>{$vo.last_time}</td>
									<td>
										<if condition="$vo['status'] eq 1">
											<span class="label label-sm label-success">可见</span>
										<else/>
											<span class="label label-sm label-warning">不可见</span>
										</if>
									</td>


									<td>
										<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
											<a class="blue" title="预览" href="{:U('Home/Index/detail','a_id='.$vo['id'])}" target="_blank">
												<i class="icon-zoom-in bigger-130"></i>
											</a>
											<if condition="$vo['status'] eq 1">
												<a class="orange" title="改为不可见"  href="{:U('updateStatus','id='.$vo['id'])}">
													<i class="icon-eye-close bigger-120"></i>
												</a>
											<else/>
												<a class="green" title="改为可见" class="btn btn-xs btn-success" href="{:U('updateStatus','id='.$vo['id'])}">
													<i class="icon-eye-open bigger-120"></i>
												</a>
											</if>

											<a class="blue" title="编辑" href="{:U('edit','a_id='.$vo['id'])}">
												<i class="icon-pencil bigger-130"></i>
											</a>

											<a class="red"  title="删除" href="#">
												<i class="icon-trash bigger-130"></i>
											</a>
										</div>

										<div class="visible-xs visible-sm hidden-md hidden-lg">
											<div class="inline position-relative">
												<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
													<i class="icon-caret-down icon-only bigger-120"></i>
												</button>

												<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
													<li>
														<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
															<span class="blue">
																<i class="icon-zoom-in bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
															<span class="green">
																<i class="icon-edit bigger-120"></i>
															</span>
														</a>
													</li>

													<li>
														<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
															<span class="red">
																<i class="icon-trash bigger-120"></i>
															</span>
														</a>
													</li>
												</ul>
											</div>
										</div>
									</td>
								</tr>
							</foreach >
						</tbody>
					</table>
				</div>
			</div>
		</div>

		<!-- basic scripts -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='__PUBLIC__/assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->


		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='__PUBLIC__/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="__PUBLIC__/assets/js/bootstrap.min.js"></script>
		<script src="__PUBLIC__/assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<script src="__PUBLIC__/assets/js/jquery.dataTables.min.js"></script>
		<script src="__PUBLIC__/assets/js/jquery.dataTables.bootstrap.js"></script>

		<!-- ace scripts -->

		<script src="__PUBLIC__/assets/js/ace-elements.min.js"></script>
		<script src="__PUBLIC__/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			jQuery(function($) {
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
		</script>

</body>
</html>
